<?php
class ChangeItem extends Zend_Db_Table
{
	protected $_name = "changeitem";
	
	public function getChangeHistory($issueId)
	{
		$select = $this->_db->select()
					->from(array('ci'=> $this->_name))
					->join(array('cg'=>'changegroup'),'ci.groupid = cg.id')
					->where('cg.issueid = ?', $issueId);
		$results = $this->getAdapter()->fetchAll($select);
		return $results;
	}
	public function getChangeItemsData($groupId)
	{
		$select = $this->_db->select()
							->from($this->_name)
							->where('groupid = ?', $groupId);
		$results = $this->getAdapter()->fetchAll($select);
		return $results;
	}
}